<?php

/**
 * Ownchoice form base class.
 *
 * @method Ownchoice getObject() Returns the current form's model object
 *
 * @package    briefing
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseOwnchoiceForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'idownchoice'   => new sfWidgetFormInputHidden(),
      'is_own_choice' => new sfWidgetFormInputCheckbox(),
      'text'          => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'idownchoice'   => new sfValidatorChoice(array('choices' => array($this->getObject()->get('idownchoice')), 'empty_value' => $this->getObject()->get('idownchoice'), 'required' => false)),
      'is_own_choice' => new sfValidatorBoolean(),
      'text'          => new sfValidatorString(array('max_length' => 50)),
    ));

    $this->widgetSchema->setNameFormat('ownchoice[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Ownchoice';
  }

}
